﻿<extend name="../Public/base" />
<block name="title"><title>评论列表</title></block>
<block name="body">
    <div class="text-c">
        <form method="post" action="{:U('index')}">
            <span class="select-box inline">
                <select name="status" class="select">
                    <option value="0">全部评论</option>
                    <option value="-1" <if condition="$status eq -1">selected</if>>未审核</option>
                    <option value="1" <if condition="$status eq 1">selected</if>>已审核</option>
                </select>
            </span>
            <!--<input type="text" name="" id="" placeholder=" 资讯名称" style="width:250px" class="input-text ml-5">-->
            <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont"></i> 搜评论</button>
        </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
            <a href="javascript:;" onclick="dels('comment_id')" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
            <a href="javascript:;" onclick="dels('comment_id','changeStatus')" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 批量审核</a></span>
    </div>
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg">
            <thead>
            <tr class="text-c">
                <th width="5%"><input type="checkbox" name="" value=""></th>
                <th width="5%">ID</th>
                <th width="15%">文章标题	</th>
                <th width="10%">评论用户</th>
                <th width="15%">评论时间</th>
                <th width="35%">评论内容</th>
                <th width="5%">状态</th>
                <th width="15%">操作</th>
            </tr>
            </thead>
            <tbody>
            <volist name="list" id="info">
                <tr class="text-c">
                    <td><input type="checkbox" name="comment_id[]" value="{$info.comment_id}"></td>
                    <td>{$info.comment_id}</td>
                    <td>{$articles[$info['article_id']]['title']}</td>
                    <td>{$info.nickname}</td>
                    <td>{$info.create_time|date="Y-m-d H:i:s",###}</td>
                    <td>{$info.content}</td>
                    <td class="td-status">
                        <eq name='info.status' value='1'>
                            <span class="label label-success radius">已审核</span>
                            <else/>
                            <span class="label label-success radius">未审核</span>
                        </eq>
                    </td>
                    <td class="f-14">
                        <eq name='info.status' value='1'>
                            <a  onclick="comment_status('{$info.comment_id}')" href="javascript:;" title="取消审核">取消审核</a>
                            <else/>
                            <a  onclick="comment_status('{$info.comment_id}')" href="javascript:;" title="通过审核">通过审核</a>
                        </eq>
                        <a title="删除" href="javascript:;" onclick="del('{$info.comment_id}','comment_id')" class="ml-5" >
                            <i class="Hui-iconfont">&#xe6e2;</i>
                        </a>

                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
        </div>
        <div class='paging_simple_numbers'>
           {$page}
        </div>
    </div>
</block>
<block name="js">
    <script type="text/javascript">

        //文章发布状态
        function comment_status(id){
            action('确认要改变评论审核状态吗？',id,"{:U('changeStatus')}",'comment_id');
        }

    </script>
</block>